package com.ruoyi.bearing.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bearing.mapper.OptimizedModelMapper;
import com.ruoyi.bearing.domain.OptimizedModel;
import com.ruoyi.bearing.service.IOptimizedModelService;

/**
 * 最优诊断与预测模型Service业务层处理
 */
@Service
public class OptimizedModelServiceImpl implements IOptimizedModelService {
    @Autowired
    private OptimizedModelMapper optimizedModelMapper;

    /**
     * 查询最优诊断与预测模型
     */
    @Override
    public OptimizedModel selectOptimizedModelById(String id) {
        return optimizedModelMapper.selectOptimizedModelById(id);
    }

    /**
     * 查询最优诊断与预测模型列表
     */
    @Override
    public List<OptimizedModel> selectOptimizedModelList(OptimizedModel optimizedModel) {
        return optimizedModelMapper.selectOptimizedModelList(optimizedModel);
    }

    /**
     * 新增最优诊断与预测模型
     */
    @Override
    public int insertOptimizedModel(OptimizedModel optimizedModel) {
        optimizedModel.setCreateTime(DateUtils.getNowDate());
        optimizedModel.setId(IdUtils.simpleUUID());
        return optimizedModelMapper.insertOptimizedModel(optimizedModel);
    }

    /**
     * 修改最优诊断与预测模型
     */
    @Override
    public int updateOptimizedModel(OptimizedModel optimizedModel) {
        optimizedModel.setUpdateTime(DateUtils.getNowDate());
        return optimizedModelMapper.updateOptimizedModel(optimizedModel);
    }

    /**
     * 批量删除最优诊断与预测模型
     */
    @Override
    public int deleteOptimizedModelByIds(String[] ids) {
        return optimizedModelMapper.deleteOptimizedModelByIds(ids);
    }

    /**
     * 删除最优诊断与预测模型信息
     */
    @Override
    public int deleteOptimizedModelById(String id) {
        return optimizedModelMapper.deleteOptimizedModelById(id);
    }
}
